코드를 읽기 좋은 순서로 바꾸기. 타이딩 중 하나.
“
Reorder the code in the file in the order in which a reader (remember, there are many readers for each writer) would prefer to encounter it. … No single ordering of elements is perfect. Sometimes you want to understand the primitives first and then understand how they compose. Sometimes you want to understand the API first and then understand the details of implementation. —Tidy first? A personal exercise in empirical software design
목차 목차 관련 글 New interface, old implementation “A personal exercise in empirical software design” One pile “Sometimes you read code that's been split into many tiny pieces, but in a way that hinders you from understandi…” Explaining comments “You know that moment when you're reading some code and you say, "Oh, so that's what's going on!"” Guard clauses “A personal exercise in empirical software design” 죽은 코드 “A personal exercise in empirical software design” First, After, Later, Never “A personal exercise in empirical software design 2부 중에서 발췌, 요약.” Extract helper “You see a block of code inside a routine that has an obvious purpose and limited interaction with the rest of t…” Separate tidying “A personal exercise in empirical software design” Explicit parameters “A personal exercise in empirical software design” Move declaration and initialization together “A personal exercise in empirical software design” 경험적 소프트웨어 설계 “A personal exercise in empirical software design” Chunk statements “You're reading a big chunk of code and you realize, "Oh, this part does this and then that part does that."” Explaining variables “A personal exercise in empirical software design” 설계를 언제 할까 “Speculative design: We know what we want to do next, so let’s design for it today.” Normalize symmetries “That's okay, but it makes for difficult reading.” Explaining constants “A personal exercise in empirical software design” Understandability and predictability “For normally we start from whatevery behavior we want to get, then try to design a system that will produce it.” 내가 구독한 주제 목록에 기반한 내 소개 관련 절: About Me Programmer's brain “Comparing reading and learning natural language to reading and learning code” Ten principles for good design 관련 절: Steph Ango